home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / Biomorph 0.77 / Funcs src / z3-z2+c.c < prev   
Encoding:
C/C++ Source or Header  |  1993-05-07  |  447 b   |  19 lines  |  [TEXT/ALFA]

  1. /*
  2. ** This is a 'morf' ECR that implements the above function.
  3. */
  4.  
  5. #include "complex.h"
  6.  
  7. // ------------
  8.  
  9. void main(ImagPt *Zold, ImagPt *C, ImagPt *Znew);
  10.  
  11. void main(ImagPt *Zold, ImagPt *C, ImagPt *Znew)
  12. {
  13.     ImagPt temp1, temp2;
  14.     
  15.     SquareC( Zold, &temp1);        // temp1 = z^2
  16.     MultC( Zold, &temp1, &temp2);  // temp2 = Z^3
  17.     SubC( &temp2, &temp1, &temp2); // temp2 = Z^3 - Z^2
  18.     AddC( &temp2, C, Znew);        // Znew = Z^3 - Z^2 + C
  19. } // z3-z2+c